import 'package:Smart/pages/productor006/project/pages/gs_callout_page.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:Smart/utils/routers/page_jump_service.dart';
//屏幕适配
import 'package:Smart/utils/screen_unit/gs_screen_util.dart';
import '../res/colors_res.dart';
import 'package:flutter/cupertino.dart';

//申请权限弹出框
Widget GSBlueToothDialog(
    BuildContext context, String message, String cancelTxt, String confrimTxt) {
  return Scaffold(
    backgroundColor: Colors.transparent,
    body: Center(
      child: Stack(
        overflow: Overflow.visible,
        alignment: Alignment.center,
        children: <Widget>[
          Container(
            width: 314.w,
            height: 321.w,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(10.w),
              color: ColorsRes.color_ffffff,
            ),
            //弹框开始
            child: Column(
              mainAxisSize: MainAxisSize.min,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                //中间部分内容
                Container(
                  alignment: Alignment.centerLeft,
                  margin: EdgeInsets.only(top: 60.w),
                  width: 260.w,
                  height: 138.w,
                  child: Text(
                    message,
                    style: TextStyle(
                        fontSize: 18.w,
                        color: ColorsRes.color_141413,
                        decoration: TextDecoration.none),
                    //多行设置行高
                    strutStyle: StrutStyle(
                        forceStrutHeight: true, height: 1.4, leading: 1.3),
                  ),
                ),
                //按钮
                Container(
                  padding: EdgeInsets.only(
                    top: 30.w,
                  ),
                  child: Row(
                    // mainAxisSize: MainAxisSize.min,
                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                    children: <Widget>[
                      //弹框'取消'按钮
                      GestureDetector(
                        onTap: () {
                          Navigator.of(context).pop();
                        },
                        child: Container(
                          width: 137.w,
                          height: 44.w,
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(26.w),
                              border:
                                  Border.all(color: ColorsRes.color_D7E600)),
                          child: Center(
                            child: Text(
                              cancelTxt,
                              style: TextStyle(
                                  color: ColorsRes.color_141413,
                                  fontSize: 18.w,
                                  decoration: TextDecoration.none),
                            ),
                          ),
                        ),
                      ),
                      //弹框'确认'按钮
                      GestureDetector(
                        onTap: () {
                          openAppSettings();
                        },
                        child: Container(
                          width: 137.w,
                          height: 44.w,
                          decoration: BoxDecoration(
                              color: ColorsRes.color_D7E600,
                              borderRadius: BorderRadius.circular(26.w),
                              border:
                                  Border.all(color: ColorsRes.color_D7E600)),
                          child: Center(
                            child: Text(
                              confrimTxt,
                              style: TextStyle(
                                  color: ColorsRes.color_141413,
                                  fontSize: 18.w,
                                  decoration: TextDecoration.none),
                            ),
                          ),
                        ),
                      )
                    ],
                  ),
                )
              ],
            ),
          ),
          //弹框顶部居中按钮
          Positioned(
            // left: 110,
            top: -32.w,
            child: Container(
              child: Image.asset(
                "assets/images/productor006/蓝牙钥匙.png",
                width: 68.w,
                height: 68.w,
              ),
            ),
          ),
          //弹出框底部关闭按钮
          Positioned(
            bottom: 0,
            child: GestureDetector(
              onTap: () {
                Navigator.of(context).pop();
              },
              child: Container(
                child: Image.asset(
                  "assets/images/productor006/popclose.png",
                  width: 45.w,
                  height: 45.w,
                ),
              ),
            ),
          ),
        ],
      ),
    ),
  );
}
